<?php
namespace App\Admin\Controllers;

use App\Http\Controllers\Controller;



use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Logics\SuggestionLogic;

use Illuminate\Support\Facades\Storage;

use Encore\Admin\Widgets\Box;
class SuggestionController extends BaseController{

    private function getInstance(){
        static $ob=null;
        if($ob===null){
            $ob=new SuggestionLogic();
        }
        return $ob;
    }
    //列表
    public function index( )
    {
        $page = (int)request("page", 1);
        $per_page = (int)request("per_page", 20);
        $phone=trim(request('phone'));
        $name=trim(request('name'));
        $start_time=trim(request('start_time',''));
        $end_time=trim(request('end_time',''));
        $para=[
            'page'=>$page,
            'per_page'=>$per_page,
            'phone'=>$phone,
            'name'=>$name,
            'start_time'=>$start_time,
            'end_time'=>$end_time
        ];
        $ob=$this->getInstance();
        $data=$ob->index($para);
        if($data && is_string($data)) die(json_error($data));

        $content= view("admin.suggestion.index",$data) ;
        $data=[
            'content'=>$content,
            'header'=>'意见反馈列表',
        ];
        return  $this->baseList($data);
    }








}